[release/8.0-staging] Back port logical equivalent of #102838 #113230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a logical back port of #102838. The store providers went through a significant refactoring in .NET 9, so the changes would not back port cleanly to .NET 8.
/cc @bartonjs
Customer Impact
Reported by a customer in #113227 asking to apply the same fix in #102838. When the OpenSSL system and directory stores needed to be refreshed, a lock is taken. However, when the thread acquired the lock, the information about needing to refresh the store is stored in a local. This would lead to all threads that wait on the lock performing a store refresh because the locals were not updated after the lock was acquired.
The fix is to re-assign the locals with up-to-date information after the lock is taken.
Regression
No.
Testing
Existing tests ensure no functional changes are introduced.
Risk
Low. A similar fix was made for .NET 9. The change is isolated and simple to reason about.